package org.rcy.framework.mq.serializer;

import org.rcy.framework.api.mq.AbstractMessage;

import java.io.Closeable;

/**
 * @author 吴康桥
 * @Description
 * @date 2022/11/11 17:56
 */

public interface Serializer<M extends AbstractMessage> extends Closeable {
    byte[] serialize(M message) throws Exception;

    M deserialize(byte[] body, Class<?> clazz) throws Exception;

}
